<template>
  <div class="home">
    <div class="carousel">
      <el-carousel :interval="4000" type="card" height="200px">
        <el-carousel-item v-for="item in 6" :key="item">
          <h3 text="2xl" justify="center">{{ item }}</h3>
        </el-carousel-item>
      </el-carousel>
    </div>
    <div class="artworks_top">
      <span class="artworks_top_t">New Artworks</span>
      <div class="artworks_top_More">
        <span class="view_more">View More</span><SvgIcon name="right_arrow"></SvgIcon>
      </div>
    </div>
    <!-- New Artworks -->
    <div class="artworks">
      <ul class="artworks_scr">
        <li class="artworks_item" v-for="(li, i) in artworks" :key="i">
          <img class="artworks_img" :src="li.img" />
          <div class="user">
            <img class="user_headPicture" :src="li.headPicture" />
            <span class="user_nickname">{{ li.nickname }}</span>
          </div>
        </li>
      </ul>
    </div>

    <div class="artworks_top">
      <span class="artworks_top_t">New Artist</span>
      <div class="artworks_top_More">
        <span class="view_more">View More</span><SvgIcon name="right_arrow"></SvgIcon>
      </div>
    </div>
    <!-- New Artist -->
    <div class="artist">
      <ul class="artist_scr">
        <li class="artist_item" v-for="(li, i) in artist" :key="i">
          <img class="artist_img" :src="li.img" />
          <p class="title">{{ li.title }}</p>
        </li>
      </ul>
    </div>
    <div class="down">
      <div class="download_grup">
        <p class="doen_text">Download SHOWQASE and unlock the AR feature now!</p>
        <div class="but">
          <button>App Store</button>
          <button>Google Play</button>
        </div>
      </div>
    </div>
  </div>
</template>

<script setup lang="ts">
import { reactive } from 'vue';

// defineOptions({
//   name: 'Home',
// });

/** artworks */
const artworks = reactive([
  {
    img: 'https://geminglu-static-r2yk.vercel.app/Image.png',
    link: '',
    nickname: 'Gabriel Barcia-Colombo',
    headPicture: 'https://geminglu-static-r2yk.vercel.app/Avatar.png',
  },
  {
    img: 'https://geminglu-static-r2yk.vercel.app/Image.png',
    link: '',
    nickname: 'Gabriel Barcia-Colombo',
    headPicture: 'https://geminglu-static-r2yk.vercel.app/Avatar.png',
  },
  {
    img: 'https://geminglu-static-r2yk.vercel.app/Image.png',
    link: '',
    nickname: 'Gabriel Barcia-Colombo',
    headPicture: 'https://geminglu-static-r2yk.vercel.app/Avatar.png',
  },
  {
    img: 'https://geminglu-static-r2yk.vercel.app/Image.png',
    link: '',
    nickname: 'Gabriel Barcia-Colombo',
    headPicture: 'https://geminglu-static-r2yk.vercel.app/Avatar.png',
  },
  {
    img: 'https://geminglu-static-r2yk.vercel.app/Image.png',
    link: '',
    nickname: 'Gabriel Barcia-Colombo',
    headPicture: 'https://geminglu-static-r2yk.vercel.app/Avatar.png',
  },
  {
    img: 'https://geminglu-static-r2yk.vercel.app/Image.png',
    link: '',
    nickname: 'Gabriel Barcia-Colombo',
    headPicture: 'https://geminglu-static-r2yk.vercel.app/Avatar.png',
  },
]);

/** artist */
const artist = reactive([
  {
    img: 'https://geminglu-static-r2yk.vercel.app/Avatar1.png',
    title: 'Darlos Xstillo',
  },
  {
    img: 'https://geminglu-static-r2yk.vercel.app/Avatar1.png',
    title: 'Darlos Xstillo',
  },
  {
    img: 'https://geminglu-static-r2yk.vercel.app/Avatar1.png',
    title: 'Darlos Xstillo',
  },
  {
    img: 'https://geminglu-static-r2yk.vercel.app/Avatar1.png',
    title: 'Darlos Xstillo',
  },
  {
    img: 'https://geminglu-static-r2yk.vercel.app/Avatar1.png',
    title: 'Darlos Xstillo',
  },
  {
    img: 'https://geminglu-static-r2yk.vercel.app/Avatar1.png',
    title: 'Darlos Xstillo',
  },
  {
    img: 'https://geminglu-static-r2yk.vercel.app/Avatar1.png',
    title: 'Darlos Xstillo',
  },
  {
    img: 'https://geminglu-static-r2yk.vercel.app/Avatar1.png',
    title: 'Darlos Xstillo',
  },
  {
    img: 'https://geminglu-static-r2yk.vercel.app/Avatar1.png',
    title: 'Darlos Xstillo',
  },
  {
    img: 'https://geminglu-static-r2yk.vercel.app/Avatar1.png',
    title: 'Darlos Xstillo',
  },
]);
</script>
<style scoped lang="less">
.el-carousel__item h3 {
  color: #475669;
  opacity: 0.75;
  line-height: 200px;
  margin: 0;
  text-align: center;
}

.el-carousel__item:nth-child(2n) {
  background-color: #99a9bf;
}

.el-carousel__item:nth-child(2n + 1) {
  background-color: #d3dce6;
}
.carousel {
  margin-top: 80px;
}
.home {
  overflow: hidden;
  .artworks {
    overflow: overlay;
    width: 100%;
    .artworks_scr {
      width: 1428px;
      margin: 0;
      padding: 0;
      font-size: 0;
      .artworks_item {
        display: inline-block;
        overflow: hidden;
        width: 226px;
        margin-left: 12px;
        list-style: none;
        .artworks_img {
          width: 226px;
          height: 152px;
          border-radius: 5px;
          cursor: pointer;
        }
        .user {
          margin-top: 8px;
          .user_headPicture {
            width: 24px;
            height: 24px;
            border-radius: 50%;
            vertical-align: middle;
            cursor: pointer;
          }
          .user_nickname {
            display: inline-block;
            width: 196px;
            font-size: 13px;
            color: white;
            vertical-align: middle;
            margin-left: 6px;
            white-space: nowrap;
            overflow: hidden;
            text-overflow: ellipsis;
            cursor: pointer;
          }
        }
      }
    }
    &::-webkit-scrollbar {
      display: none;
    }
  }
  .artworks_top {
    margin-left: 12px;
    margin-bottom: 12px;
    margin-top: 100px;
    display: flex;
    flex-direction: row;
    flex-wrap: nowrap;
    justify-content: space-between;
    align-items: center;
    .artworks_top_t {
      font-weight: 500;
      font-size: 20px;
      line-height: 24px;
      color: #6b6b6b;
    }
    .artworks_top_More {
      font-weight: 400;
      font-size: 13px;
      line-height: 24px;
      color: #c19c95;
      cursor: pointer;
      margin-right: 12px;
    }
  }
}
.artist {
  overflow: overlay;
  padding-left: 12px;

  &::-webkit-scrollbar {
    display: none;
  }
  .artist_scr {
    width: 1416px;
    margin: 0;
    padding: 0;
    font-size: 0;
    .artist_item {
      display: inline-block;
      overflow: hidden;
      width: 100px;
      margin-left: 45px;
      list-style: none;
      &:first-child {
        margin-left: 0;
      }
      .artist_img {
        width: 100px;
        height: 100px;
        border-radius: 50%;
        cursor: pointer;
      }
      .title {
        margin: 12px 0;
        text-align: center;
        font-weight: 400;
        font-size: 13px;
        color: white;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
      }
    }
  }
}
.down {
  position: relative;
  margin-top: 100px;
  margin-bottom: 60px;
  display: flex;
  flex-direction: row;
  flex-wrap: nowrap;
  justify-content: center;
  .download_grup {
    width: 702px;
    height: 70px;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    border-radius: 3px;
    backdrop-filter: blur(2px);
    background-color: #c1d746;
    background-image: url('/src/assets/images/Vector.png');
    background-position: center;
    background-size: 40%;
    margin: 0 12px;
    padding: 11px 20px;
    .doen_text {
      margin: 0;
      font-weight: 700;
      font-size: 14px;
      color: #004b53;
      text-align: center;
      margin-right: 10px;
    }
    .but {
      button {
        margin: 0 6px;
        padding: 5px 10px;
        width: 112px;
        height: 34px;
        outline: 0;
        border: none;
        background: rgba(255, 255, 255, 0.85);
        box-shadow: 0px 4px 8px rgba(0, 0, 0, 0.3);
        border-radius: 5px;
        cursor: pointer;
        font-weight: 700;
        font-size: 15px;
        color: #004b53;
      }
    }
  }
}

@media screen and (max-width: 480px) {
  .artworks_top {
    margin-top: 34px !important;
    .artworks_top_t {
      font-size: 13px !important;
      line-height: 22px !important;
    }
    .artworks_top_More {
      .view_more {
        display: none;
      }
    }
  }
  .artworks_scr {
    width: 1026px !important;
  }
  .artworks_item {
    width: 159px !important;
    .artworks_img {
      width: 159px !important;
      height: 106px !important;
    }

    .user {
      .user_nickname {
        width: 125px !important;
        font-size: 11px !important;
      }
    }
  }
  .home {
    .carousel {
      margin-top: 30px;
    }
    .artist {
      .artist_item {
        width: 50px;
        .artist_img {
          width: 50px;
          height: 50px;
        }
        .title {
          font-size: 11px;
        }
      }
    }
    .down {
      margin-top: 34px;
      margin-block: 30px;
      .download_grup {
        width: 313px;
        height: 118px;
        background-size: 80%;
      }
    }
  }
}
</style>
